#! /bin/bash -f
awk '{if($3 ~ /\[[a-z]+[0-9]\]/) {print $3,$2,$1}}' $1 | sort -k 1 | sed 's|^\[\([a-z]\+[0-9]\)\]|\1|g' | awk 'BEGIN{lp=""} {if($1 == lp) {printf(" %s %s",$2,$3)} else {if(lp!="")printf("\n"); printf("%s %s %s",$1,$2,$3); lp=$1}} END{printf("\n")}' | awk '{printf("|| %s ||",$1); for(i=2;i<=NF;i+=2){printf(" %s",$(i));} printf(" ||"); for(i=3;i<=NF;i+=2){printf(" %s",$(i));} printf(" ||\n");}'
